package demo01.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by ztt on 2017/9/25.
 */
@Aspect
@Component
public class Aop03 {

    @Pointcut("execution(public * demo01.bean..*.*(int))")
    public void recordLog(){}

    @Around("recordLog()")
    public void silenceCellPhones(ProceedingJoinPoint pj){
        System.out.println("@Around……之前 ");
        try {
            pj.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("@Around……之后 ");
    }
}
